package com.example.springsecurity.service;

import com.example.springsecurity.domain.Declare;
import com.example.springsecurity.domain.SysUser;
import com.example.springsecurity.utils.ResultBean;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @ClassName SysUserService
 * @Description TODO
 * @Author lvyongwei
 * @Date 2020-08-17 18:07
 **/
public interface SysUserService {

    /**
     * 根据用户名查询用户信息
     * @param userName
     * @return
     */
    public SysUser getUserByUserName(String userName);

    /**
     * 注册/添加系统用户
     * @param sysUser
     * @return
     */
    public boolean insertSysUser(SysUser sysUser);

    /**
     * 判断用户名是否重复
     * @param userName
     * @return
     */
    public SysUser verifyUserName(String userName);

    /**
     * 判断电话是否重复
     * @param phone
     * @return
     */
    public SysUser verifyPhone(String phone);

    /**
     * 判断电话是否重复
     * @param email
     * @return
     */
    public SysUser verifyEmail(String email);

    /**
     * 修改用户密码
     * @param userName 用户名
     * @param password 新密码
     * @return
     */
    public boolean updatePassword(String userName, String password);

    /**
     * 删除 / 停用用户
     * @param userIds  用户id
     * @param delStatus   用户状态
     * @return
     */
    public boolean changeUserStatus(Long[] userIds,int delStatus);

    /**
     * 修改用户信息
     * @param sysUser  系统用户信息
     * @return
     */
    public boolean updateSysUser(SysUser sysUser);

    /**
     * 导入用户信息
     * @param file
     * @param sysUser
     * @return
     */
    public ResultBean importSysUser(MultipartFile file, SysUser sysUser);

    /**
     * 获取所有用户信息
     * @param sysUser
     * @return
     */
    public List<SysUser> getAllSysUser(SysUser sysUser);

    /**
     * 获取所有学生用户信息
     * @param sysUser
     * @return
     */
    public List<SysUser> getAllStudent(SysUser sysUser);

    ResultBean addDeclareProject(Declare declare);

    ResultBean updateDeclareProject(Declare declare);

    ResultBean getDeclareProject(Integer declareId);

    ResultBean getAllDeclareProject(Integer pageNum, Integer pageSize);

    ResultBean checkShortLink(Declare declare);

    ResultBean avoidLogin(Declare declare);

    ResultBean deleteDeclareProject(Integer declareId);

    ResultBean getDeclareProjectUser(String username);


    /**
     * 重置密码
     * @param sysUser
     * @return
     */
    public boolean resetPassword(SysUser sysUser);
}
